#include "grid.h"

#include "color.h"

namespace Splatit {
	
Grid::Grid(unsigned int _width, unsigned int _height) : width(_width) , height(_height) { 
	pixels = new Color* [_width];
	for(unsigned int i = 0; i < _width; i++)
		pixels[i] = new Color[_height];

}

Grid::Grid(Grid& g) : width(g.width) , height(g.height) { 
	pixels = new Color* [g.width];
	for(unsigned int i = 0; i < g.width; i++)
		pixels[i] = new Color[g.width];
}

Grid::~Grid(void) {
	for (unsigned int i = 0; i < width; i++)
		delete[] pixels[i];
        delete[] pixels;
}

void Grid::set_pixel(unsigned int _x,unsigned int _y,const Color& _color) {
	pixels[_x][_y] = _color;
}

}
